package com.sgcc.lms.openstack.service;

import com.sgcc.lms.openstack.exception.*;
import org.openstack4j.model.common.ActionResponse;
import org.openstack4j.model.image.v2.Image;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-07-21 14:18
 * @Description:
 */
public interface GlanceService {

    /**
    * @Author 李孟帅
    * @Description 列出镜像
    * @Date 2020/7/21
    **/
    List<? extends Image> images(String tokenId) throws NullTokenException;

    /**
    * @Author 李孟帅
    * @Description 显示镜像详细信息
    * @Date 2020/7/21
    **/
    Image getImage(String tokenId,String id) throws NullTokenException;

    /**
    * @Author 李孟帅
    * @Description 创建镜像
    * @Date 2020/7/21
    **/
    Image createImage(String tokenId,Image image) throws NullTokenException;

    /**
    * @Author 李孟帅
    * @Description 更新镜像
    * @Date 2020/7/21
    **/
    Image updateImage(String tokenId,Image image) throws HttpException, IOException;

    /**
    * @Author 李孟帅
    * @Description 删除镜像
    * @Date 2020/7/21
    **/
    ActionResponse delete(String tokenId,String id) throws NullTokenException;

    /**
    * @Author 李孟帅
    * @Description 上传镜像
    * @Date 2020/7/21
    **/
    ActionResponse uploadImage(String tokenId, MultipartFile file,String id) throws NullTokenException, IOException;

    /**
     * @Author 李孟帅
     * @Description 下载镜像
     * @Date 2020/7/21
     **/
    ActionResponse downloadImage(String tokenId, HttpServletResponse response,String id) throws NullTokenException;
}
